/* Copyright (c) 2010 OFXKit
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#import <Foundation/Foundation.h>
#import "OFXObject.h"

@interface OFXStatus : OFXObject {
  NSString* name;
  NSString* serverMessage;
  NSString* code;
  NSString* severity;
}

/**
 * @property name
 * @brief Name of status message.
 */
@property(retain) NSString* name;

/**
 * @property serverMessage
 * @brief Message from server describing status.
 */
@property(retain) NSString* serverMessage;

/**
 * @property code
 * @brief Status code
 *
 * Possible values:
 * - 0: Success (INFO)
 * - 2000: General error (ERROR)
 * - 3000: User credentials are correct, but further authentication required 
 * (ERROR) This notifies client to send <MFACHALLENGERQ>.
 * - 3001: MFACHALLENGEA contains invalid information (ERROR)
 * - 13504: <FI> Missing or Invalid in <SONRQ> (ERROR)
 * - 15000: Must change USERPASS (INFO)
 * - 15500: Signon invalid (ERROR)
 * - 15501: Customer account already in use (ERROR)
 * - 15502: USERPASS Lockout (ERROR)
 * - 15506: Empty signon transaction not supported (ERROR)
 * - 15507: Signon invalid without supporting pin change request (ERROR)
 * - 15510: CLIENTUID error (ERROR)
 * - 15511: User should contact financial institution (ERROR)
 * - 15512: OFX server requires AUTHTOKEN in signon during the next session 
 * (ERROR)
 * - 15513: AUTHTOKEN invalid (ERROR)
 */
@property(retain) NSString* code;

/**
 * @property severity
 * @brief Severity of the response message
 * 
 * Valid values:
 * - INFO = Informational only 
 * - WARN = Some problem with the request occurred but a valid response still 
 * present 
 * - ERROR = A problem severe enough that response could not be made
 */
@property(retain) NSString* severity;

/**
 * Initialize the status object with specified values.
 *
 * @params statusName Name of status message
 * @params statusCode Code of status response
 * @params statusServerMessage Server message of status response
 * @params statusSeverity Severity of status response
 *
 * @returns Initialized status object
 */ 
- (id)initWithName:(NSString*)statusName 
          withCode:(NSString*)statusCode
  withServerMessage:(NSString*)statusServerMessage
       withSeverity:(NSString*)statusSeverity;

@end
